﻿using RBAC.MaHaiBo.API.Application.Command.UserCommand;
using RBAC.MaHaiBo.Repository;
using MediatR;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.UserHandler
{
    public class UserDeleteCommandHandlers : IRequestHandler<UserDeleteCommand, int>
    {
        IUserService User;

        public UserDeleteCommandHandlers(IUserService User)
        {
            this.User = User;
        }

        public async Task<int> Handle(UserDeleteCommand request, CancellationToken cancellationToken)
        {
            return await User.DeleteUser(request.Uid);
        }
    }

}
